<!--
To change this template, choose Tools | Templates
and open the template in the editor.
-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <title></title>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <script type="text/javascript" src="scripts/rangy-core-uc.js"></script>
    </head>
    <body>
        <div id="div1" contenteditable="true">TODO write content</div>
        <textarea id="ta1" style="width: 400px;height: 100px"></textarea>
        <button onclick="showDya();">Show</button>
        <script type="text/javascript">
            var div1 = document.getElementById("div1");
            var ta1 = document.getElementById("ta1");
            //First init
            rangy.init();
            function showDya() {
                var msgDiv = document.getElementById("msgDiv");
                var range = rangy.createRange(document);
                //alert(range.toString());
                range.selectNodeContents(ta1);
                msgDiv.innerHTML = "toHTML: "+range.toHtml();
                range.insertNode(div1);
                
            }
           
        </script>
        <div id="msgDiv"></div>
    </body>
</html>
